home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-12-25 | 1.1 KB | 54 lines | [TEXT/CWIE] |
- unit MyErrors;
-
- interface
-
- uses
- Types;
-
- const
- error_id = 925; { STR#, ERRS, ALRT, DITL. override ERRS with ERRS=128 }
-
- procedure DisplayError (msg: integer; err: OSErr);
- procedure DisplayErrorString ( const msg: Str255; err: OSErr); { ^1 -> err }
- function GetErrorStr( err: OSErr ): Str255;
-
- implementation
-
- uses
- Errors, TextUtils,
- MyErrorStrings, MyCleverAlerts, MyStrings;
-
- procedure DisplayError (msg: integer; err: OSErr);
- var
- s: Str255;
- begin
- GetIndString( s, error_id, msg );
- DisplayErrorString( s, err );
- end;
-
- function GetErrorStr( err: OSErr ): Str255;
- var
- e: Str255;
- begin
- if not ErrorString(128, err, e) then begin
- e := ErrorStr(error_id, err);
- end;
- GetErrorStr := e;
- end;
-
- procedure DisplayErrorString ( const msg: Str255; err: OSErr);
- var
- s, e: Str255;
- begin
- if (err <> noErr) & (err <> userCanceledErr) then begin
- if not ErrorString(128, err, e) then begin
- e := ErrorStr(error_id, err);
- end;
- s := msg;
- SPrintS3(s, s, e, '', '');
- CleverParamText('', s, '', '');
- CleverNotifyAlert(error_id);
- end;
- end;
-
- end.